package com.tgy.crud.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = 7761564745072315623L;
    @NotNull
    @Pattern(regexp = "[0-9a-zA-Z]{4,6}",message = "用户名不符合规格")
    private String  username;

    @Length(min = 4,max = 10,message = "密码不符合规范")
    private String password;
}
